<template>
    <Modal
            width="800"
            v-model="visible"
            :title="title"
            :styles="{top: '20px'}"
    >
        <div style="margin-top:10px ">
            <vxe-table border
                       resizable
                       row-id="id"
                       :row-key="true"
                       show-overflow="tooltip"
                       align="center"
                       header-align="center"
                       ref="xTree"
                       :loading="Loading"
                       :radio-config="{highlight: true}"
                       @cell-click="selectChange"
                       :data="tableData">
                <vxe-table-column type="radio" width="60" align="center"/>
                <vxe-table-column field="ssfk0002" title="低保保障信息查询批次 " align="center"/>
            </vxe-table>
            <Page :total="dataCount" :page-size="pageSize" show-total class="paging"
                  @on-change="handleTableChange" :current="pageNo"   ></Page>
        </div>
        <div slot="footer">
            <Button @click="cancel">取消</Button>
            <Button type="primary" @click="ok">确定</Button>
        </div>
    </Modal>
</template>

<script>
    import {CommonMixin} from '@/views/common/js/CommonMixin'

    export default {
        mixins: [CommonMixin],
        data() {
            return {
                title: "低保保障信息查询批次",
                visible: false,
                disableSubmit: false,
                model: {},
                url: {
                    list: "/api/ac/subsistence/Ss20002Service/batchList",
                },
                selectRow: {},
                Loading: true
            }
        },
        methods: {
            ok() {
                var ssfk0002 = "";
                if (this.selectRow) {
                    ssfk0002 = this.selectRow.ssfk0002;
                }
                this.$emit('choose', ssfk0002);
                this.cancel();
            },
            cancel() {
                this.visible = false;
            },
            edit() {
                this.loadData();
                this.selectRow = {};
                this.visible = true
            },
            selectChange({row}) {
                this.$refs.xTree.setRadioRow(row);
                this.selectRow = row;
            },
        }
    }
</script>

<style scoped>
    /deep/ .vxe-table--main-wrapper {
        min-height: 300px;
    }
</style>